package cn.com.nwpu.visual_system.controller;


import cn.com.nwpu.visual_system.entity.AllSensorData;
import cn.com.nwpu.visual_system.service.SensorService;
import cn.com.nwpu.visual_system.utils.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author Hutengzhong
 * @version 1.0.0
 * @title SensorController
 * @description TODO 与传感器相关的参数
 * @date 2024/4/28 16:20
 */
@RestController
@RequestMapping("sensor")
public class SensorController {
    @Autowired
    SensorService sensorService;

    @PostMapping("reactorAllSensor")
    public Response getAllOperateSensor(){
        HashMap<String, String[][]> resultList = sensorService.getAllOperateSensor();
        Response response = new Response(200, "操作传感器列表", true);
        response.setData(resultList);
        return response;
    }

    @PostMapping("showSensor")
    public Response getAllShowSensor(){
        AllSensorData resultData = sensorService.getAllSensor();
        Response response = new Response(200, "所有传感器列表", true);
        response.setData(resultData);
        return response;
    }
}
